home *** CD-ROM | disk | FTP | other *** search
/ IRIX 6.2 Development Libraries / SGI IRIX 6.2 Development Libraries.iso / dist / gl_dev.idb / usr / include / gl / iminterp.h.z / iminterp.h
Encoding:
C/C++ Source or Header  |  1996-03-15  |  18.5 KB  |  561 lines

  1. #ifndef __GL_IMINTERP_H__
  2. #define __GL_IMINTERP_H__
  3. /**************************************************************************
  4.  *                                      *
  5.  *          Copyright (C) 1989, Silicon Graphics, Inc.            *
  6.  *                                      *
  7.  *  These coded instructions, statements, and computer programs  contain  *
  8.  *  unpublished  proprietary  information of Silicon Graphics, Inc., and  *
  9.  *  are protected by Federal copyright law.  They  may  not be disclosed  *
  10.  *  to  third  parties  or copied or duplicated in any form, in whole or  *
  11.  *  in part, without the prior written consent of Silicon Graphics, Inc.  *
  12.  *                                      *
  13.  **************************************************************************/
  14.  
  15. /*
  16.  *  iminterp.h 
  17.  *  - some pretty complex but powerful macros by Herb Kuta to generate
  18.  *    display listable GL commands  
  19.  *
  20.  *  $Revision: 1.25 $
  21.  */
  22.  
  23. #include "cppdefs.h"
  24. #include "dlsz.h"
  25. #include "dlpers.h"
  26. #include "TheMacro.h"
  27.  
  28. #ifdef IGLOO 
  29. #define DL_EXTRA_IM_SETUP()
  30. #else
  31. #define DL_EXTRA_IM_SETUP()    im_setup
  32. #endif /* IGLOO */
  33.  
  34. #define    DL_GENCMD_0(intrp_sclass,name)                \
  35.     DL_IMMED_BEGIN(visible,name,(void))                \
  36.     {                                 \
  37.     DL_EXTRA_IM_SETUP();                    \
  38.     TOKENPASTE(im_,name)();                    \
  39.     }                                 \
  40.     DL_IMMED_END(name)                         \
  41.     DL_CMPLR_BEGIN(visible,name,(void))                \
  42.     {                                 \
  43.     BEGINCOMPILE(TOKENPASTE(DLSZ_,name));             \
  44.     ADDINTRP(name);                        \
  45.     ENDCOMPILE(TOKENPASTE(DLSZ_,name));             \
  46.     }                                 \
  47.     DL_CMPLR_END(name)                         \
  48.     DL_INTRP_BEGIN(intrp_sclass,name)                 \
  49.     {                                 \
  50.     TOKENPASTE(im_,name)();                    \
  51.     thread(name);                         \
  52.     }                                 \
  53.     DL_INTRP_END(name)
  54.  
  55.  
  56. #define    DL_GENCMD_1(intrp_sclass,name,type)            \
  57.     DL_IMMED_BEGIN(visible,name,( type x))            \
  58.     {                                 \
  59.         DL_EXTRA_IM_SETUP();                    \
  60.     TOKENPASTE(im_,name)(x);                 \
  61.     }                                 \
  62.     DL_IMMED_END(name)                         \
  63.     DL_CMPLR_BEGIN(visible,name,( type x))            \
  64.     {                                    \
  65.     BEGINCOMPILE(TOKENPASTE(DLSZ_,name));             \
  66.     ADDINTRP(name);                        \
  67.     TOKENPASTE(ADD,type)(x);                \
  68.     TOKENPASTE(ADDFILL,type)();                \
  69.     ENDCOMPILE(TOKENPASTE(DLSZ_,name));             \
  70.     }                                 \
  71.     DL_CMPLR_END(name)                         \
  72.     DL_INTRP_BEGIN(intrp_sclass,name)                 \
  73.     {                                 \
  74.     TOKENPASTE(im_,name)(TOKENPASTE(TAKE,type)(0));     \
  75.     thread(name);                         \
  76.     }                                 \
  77.     DL_INTRP_END(name)
  78.  
  79.  
  80. #define    DL_GENCMD_1C(intrp_sclass,name,type)            \
  81.     DL_IMMED_BEGIN(visible,name,( const type x))        \
  82.     {                                 \
  83.     DL_EXTRA_IM_SETUP();                    \
  84.     TOKENPASTE(im_,name)(x);                 \
  85.     }                                 \
  86.     DL_IMMED_END(name)                         \
  87.     DL_CMPLR_BEGIN(visible,name,( const type x))        \
  88.     {                                    \
  89.     BEGINCOMPILE(TOKENPASTE(DLSZ_,name));             \
  90.     ADDINTRP(name);                        \
  91.     TOKENPASTE(ADD,type)(x);                \
  92.     TOKENPASTE(ADDFILL,type)();                \
  93.     ENDCOMPILE(TOKENPASTE(DLSZ_,name));             \
  94.     }                                 \
  95.     DL_CMPLR_END(name)                         \
  96.     DL_INTRP_BEGIN(intrp_sclass,name)                 \
  97.     {                                 \
  98.     TOKENPASTE(im_,name)(TOKENPASTE(TAKE,type)(0));     \
  99.     thread(name);                         \
  100.     }                                 \
  101.     DL_INTRP_END(name)
  102.  
  103.  
  104. #define DL_GENCMD_2(intrp_sclass,name,type)            \
  105.     DL_IMMED_BEGIN(visible,name,( type x, type y))        \
  106.     {                                 \
  107.     DL_EXTRA_IM_SETUP();                    \
  108.     TOKENPASTE(im_,name)(x,y);                 \
  109.     }                                 \
  110.     DL_IMMED_END(name)                         \
  111.     DL_CMPLR_BEGIN(visible,name,( type x, type y))        \
  112.     {                                 \
  113.     BEGINCOMPILE(TOKENPASTE(DLSZ_,name));             \
  114.     ADDINTRP(name);                        \
  115.     TOKENPASTE(ADD,type)(x);                \
  116.     TOKENPASTE(ADD,type)(y);                \
  117.     ENDCOMPILE(TOKENPASTE(DLSZ_,name));             \
  118.     }                                 \
  119.     DL_CMPLR_END(name)                         \
  120.     DL_INTRP_BEGIN(intrp_sclass,name)                 \
  121.     {                                 \
  122.     TOKENPASTE(im_,name)(TOKENPASTE(TAKE,type)(0),            \
  123.             TOKENPASTE(TAKE,type)(TOKENPASTE(DLSZ_,type)));    \
  124.     thread(name);                         \
  125.     }                                 \
  126.     DL_INTRP_END(name)
  127.  
  128. #define DL_GENCMD_2_TYPES(intrp_sclass,name,type1,type2)        \
  129.     DL_IMMED_BEGIN(visible,name,( type1 x, type2 y))            \
  130.     {                                                           \
  131.     DL_EXTRA_IM_SETUP();                    \
  132.         TOKENPASTE(im_,name)(x,y);                              \
  133.     }                                                           \
  134.     DL_IMMED_END(name)                                          \
  135.     DL_CMPLR_BEGIN(visible,name,( type1 x, type2 y))            \
  136.     {                                                           \
  137.         BEGINCOMPILE(TOKENPASTE(DLSZ_,name));                   \
  138.         ADDINTRP(name);                                         \
  139.         TOKENPASTE(ADD,type1)(x);                               \
  140.         TOKENPASTE(ADD,type2)(y);                               \
  141.         ENDCOMPILE(TOKENPASTE(DLSZ_,name));                     \
  142.     }                                                           \
  143.     DL_CMPLR_END(name)                                          \
  144.     DL_INTRP_BEGIN(intrp_sclass,name)                           \
  145.     {                                                           \
  146.         TOKENPASTE(im_,name)(TOKENPASTE(TAKE,type1)(0),                  \
  147.                     TOKENPASTE(TAKE,type1)(TOKENPASTE(DLSZ_,type1)));     \
  148.         thread(name);                                           \
  149.     }                                                           \
  150.     DL_INTRP_END(name)
  151.  
  152. #define DL_SPECMD_2(intrp_sclass,name,type1,type2)         \
  153.     DL_IMMED_BEGIN(visible,name,( type1 x, type2 y))        \
  154.     {                                 \
  155.     DL_EXTRA_IM_SETUP();                    \
  156.     TOKENPASTE(im_,name)(x,y);                 \
  157.     }                                 \
  158.     DL_IMMED_END(name)                         \
  159.     DL_CMPLR_BEGIN(visible,name,( type1 x, type2 y))        \
  160.     {                                 \
  161.     BEGINCOMPILE(TOKENPASTE(DLSZ_,name));             \
  162.     ADDINTRP(name);                        \
  163.     TOKENPASTE(ADD,type1)(x);                \
  164.     TOKENPASTE(ADD,type2)(y);                \
  165.     ENDCOMPILE(TOKENPASTE(DLSZ_,name));             \
  166.     }                                 \
  167.     DL_CMPLR_END(name)                         \
  168.     DL_INTRP_BEGIN(intrp_sclass,name)                 \
  169.     {                                 \
  170.     TOKENPASTE(im_,name)(TOKENPASTE(TAKE,type1)(0),            \
  171.             TOKENPASTE(TAKE,type2)(TOKENPASTE(DLSZ_,type1)));    \
  172.     thread(name);                         \
  173.     }                                 \
  174.     DL_INTRP_END(name)
  175.  
  176. #define DL_GENCMD_3(intrp_sclass,name,type)            \
  177.     DL_IMMED_BEGIN(visible,name,( type x, type y, type z))     \
  178.     {                                 \
  179.     DL_EXTRA_IM_SETUP();                    \
  180.     TOKENPASTE(im_,name)(x,y,z);                 \
  181.     }                                 \
  182.     DL_IMMED_END(name)                         \
  183.     DL_CMPLR_BEGIN(visible,name,( type x, type y, type z))     \
  184.     {                                 \
  185.     BEGINCOMPILE(TOKENPASTE(DLSZ_,name));             \
  186.     ADDINTRP(name);                        \
  187.     TOKENPASTE(ADD,type)(x);                 \
  188.     TOKENPASTE(ADD,type)(y);                 \
  189.     TOKENPASTE(ADD,type)(z);                 \
  190.     TOKENPASTE(ADDFILL,type)();                \
  191.     ENDCOMPILE(TOKENPASTE(DLSZ_,name));             \
  192.     }                                 \
  193.     DL_CMPLR_END(name)                         \
  194.     DL_INTRP_BEGIN(intrp_sclass,name)                 \
  195.     {                                 \
  196.     TOKENPASTE(im_,name)(TOKENPASTE(TAKE,type)(0),            \
  197.             TOKENPASTE(TAKE,type)(TOKENPASTE(DLSZ_,type)),    \
  198.             TOKENPASTE(TAKE,type)(2*TOKENPASTE(DLSZ_,type)));     \
  199.     thread(name);                         \
  200.     }                                 \
  201.     DL_INTRP_END(name)
  202.  
  203. #define DL_SPECMD_3(intrp_sclass,name,type1,type2,type3)    \
  204.     DL_IMMED_BEGIN(visible,name,( type1 x, type2 y, type3 z))    \
  205.     {                                 \
  206.     im_setup;                         \
  207.     TOKENPASTE(im_,name)(x,y,z);                 \
  208.     }                                 \
  209.     DL_IMMED_END(name)                         \
  210.     DL_CMPLR_BEGIN(visible,name,( type1 x, type2 y, type3 z))   \
  211.     {                                 \
  212.     BEGINCOMPILE(TOKENPASTE(DLSZ_,name));             \
  213.     ADDINTRP(name);                        \
  214.     TOKENPASTE(ADD,type1)(x);                 \
  215.     TOKENPASTE(ADD,type2)(y);                 \
  216.     TOKENPASTE(ADD,type3)(z);                 \
  217.     ENDCOMPILE(TOKENPASTE(DLSZ_,name));             \
  218.     }                                 \
  219.     DL_CMPLR_END(name)                         \
  220.     DL_INTRP_BEGIN(intrp_sclass,name)                 \
  221.     {                                 \
  222.     TOKENPASTE(im_,name)(TOKENPASTE(TAKE,type1)(0),        \
  223.             TOKENPASTE(TAKE,type2)(TOKENPASTE(DLSZ_,type1)),    \
  224.             TOKENPASTE(TAKE,type3)(2*TOKENPASTE(DLSZ_,type2)));         \
  225.     thread(name);                         \
  226.     }                                 \
  227.     DL_INTRP_END(name)
  228.  
  229. #define DL_GENCMD_4(intrp_sclass,name,type)            \
  230.     DL_IMMED_BEGIN(visible,name,( type x, type y, type z, type w)) \
  231.     {                                 \
  232.     DL_EXTRA_IM_SETUP();                    \
  233.     TOKENPASTE(im_,name)(x,y,z,w);                 \
  234.     }                                 \
  235.     DL_IMMED_END(name)                         \
  236.     DL_CMPLR_BEGIN(visible,name,( type x, type y, type z, type w)) \
  237.     {                                 \
  238.     BEGINCOMPILE(TOKENPASTE(DLSZ_,name));             \
  239.     ADDINTRP(name);                        \
  240.     TOKENPASTE(ADD,type)(x);                 \
  241.     TOKENPASTE(ADD,type)(y);                 \
  242.     TOKENPASTE(ADD,type)(z);                 \
  243.     TOKENPASTE(ADD,type)(w);                 \
  244.     ENDCOMPILE(TOKENPASTE(DLSZ_,name));             \
  245.     }                                 \
  246.     DL_CMPLR_END(name)                         \
  247.     DL_INTRP_BEGIN(intrp_sclass,name)                 \
  248.     {                                 \
  249.     TOKENPASTE(im_,name)(TOKENPASTE(TAKE,type)(0),        \
  250.             TOKENPASTE(TAKE,type)(TOKENPASTE(DLSZ_,type)),    \
  251.             TOKENPASTE(TAKE,type)(2*TOKENPASTE(DLSZ_,type)),    \
  252.             TOKENPASTE(TAKE,type)(3*TOKENPASTE(DLSZ_,type)));     \
  253.     thread(name);                         \
  254.     }                                 \
  255.     DL_INTRP_END(name)
  256.  
  257. #define DL_GENCMD_5(intrp_sclass,name,type)            \
  258.     DL_IMMED_BEGIN(visible,name,( type x, type y, type z, type w, type q)) \
  259.     {                                 \
  260.     DL_EXTRA_IM_SETUP();                    \
  261.     TOKENPASTE(im_,name)(x,y,z,w,q);            \
  262.     }                                 \
  263.     DL_IMMED_END(name)                         \
  264.     DL_CMPLR_BEGIN(visible,name,( type x, type y, type z, type w, type q)) \
  265.     {                                 \
  266.     BEGINCOMPILE(TOKENPASTE(DLSZ_,name));             \
  267.     ADDINTRP(name);                        \
  268.     TOKENPASTE(ADD,type)(x);                 \
  269.     TOKENPASTE(ADD,type)(y);                 \
  270.     TOKENPASTE(ADD,type)(z);                 \
  271.     TOKENPASTE(ADD,type)(w);                 \
  272.     TOKENPASTE(ADD,type)(q);                 \
  273.     ENDCOMPILE(TOKENPASTE(DLSZ_,name));             \
  274.     }                                 \
  275.     DL_CMPLR_END(name)                         \
  276.     DL_INTRP_BEGIN(intrp_sclass,name)                 \
  277.     {                                 \
  278.     TOKENPASTE(im_,name)(TOKENPASTE(TAKE,type)(0),        \
  279.             TOKENPASTE(TAKE,type)(TOKENPASTE(DLSZ_,type)),    \
  280.             TOKENPASTE(TAKE,type)(2*TOKENPASTE(DLSZ_,type)),    \
  281.             TOKENPASTE(TAKE,type)(3*TOKENPASTE(DLSZ_,type)),     \
  282.             TOKENPASTE(TAKE,type)(4*TOKENPASTE(DLSZ_,type)));     \
  283.     thread(name);                         \
  284.     }                                 \
  285.     DL_INTRP_END(name)
  286.  
  287. #define DL_GENCMD_7(intrp_sclass,name,type)            \
  288.     DL_SPECMD_7(intrp_sclass,name,type,type,type,type,type,type,type)
  289.  
  290.  
  291. #define DL_SPECMD_4(intrp_sclass,name,type1,type2,type3,type4)    \
  292.     DL_IMMED_BEGIN(visible,name,( type1 x, type2 y, type3 z, type4 w)) \
  293.     {                                 \
  294.     DL_EXTRA_IM_SETUP();                    \
  295.     TOKENPASTE(im_,name)(x,y,z,w);                \
  296.     }                                 \
  297.     DL_IMMED_END(name)                         \
  298.     DL_CMPLR_BEGIN(visible,name,( type1 x, type2 y, type3 z, type4 w)) \
  299.     {                                 \
  300.     BEGINCOMPILE(TOKENPASTE(DLSZ_,name));             \
  301.     ADDINTRP(name);                        \
  302.     TOKENPASTE(ADD,type1)(x);                 \
  303.     TOKENPASTE(ADD,type2)(y);                 \
  304.     TOKENPASTE(ADD,type3)(z);                 \
  305.     TOKENPASTE(ADD,type4)(w);                 \
  306.     ENDCOMPILE(TOKENPASTE(DLSZ_,name));             \
  307.     }                                 \
  308.     DL_CMPLR_END(name)                         \
  309.     DL_INTRP_BEGIN(intrp_sclass,name)                 \
  310.     {                                 \
  311.     TOKENPASTE(im_,name)(TOKENPASTE(TAKE,type1)(0),            \
  312.             TOKENPASTE(TAKE,type2)(TOKENPASTE(DLSZ_,type1)),    \
  313.             TOKENPASTE(TAKE,type3)(2*TOKENPASTE(DLSZ_,type2)),    \
  314.             TOKENPASTE(TAKE,type4)(3*TOKENPASTE(DLSZ_,type3)));    \
  315.     thread(name);                         \
  316.     }                                 \
  317.     DL_INTRP_END(name)
  318.  
  319. #define DL_SPECMD_6(intrp_sclass,name,type1,type2,type3,type4,type5,type6)    \
  320.     DL_IMMED_BEGIN(visible,name,( type1 x, type2 y, type3 z, type4 w, type5 q, type6 a)) \
  321.     {                                 \
  322.     im_setup;                         \
  323.     TOKENPASTE(im_,name)(x,y,z,w,q,a);            \
  324.     }                                 \
  325.     DL_IMMED_END(name)                         \
  326.     DL_CMPLR_BEGIN(visible,name,( type1 x, type2 y, type3 z, type4 w, type5 q, type6 a)) \
  327.     {                                 \
  328.     BEGINCOMPILE(TOKENPASTE(DLSZ_,name));             \
  329.     ADDINTRP(name);                        \
  330.     TOKENPASTE(ADD,type1)(x);                 \
  331.     TOKENPASTE(ADD,type2)(y);                 \
  332.     TOKENPASTE(ADD,type3)(z);                 \
  333.     TOKENPASTE(ADD,type4)(w);                 \
  334.     TOKENPASTE(ADD,type5)(q);                 \
  335.     TOKENPASTE(ADD,type6)(a);                 \
  336.     ENDCOMPILE(TOKENPASTE(DLSZ_,name));             \
  337.     }                                 \
  338.     DL_CMPLR_END(name)                         \
  339.     DL_INTRP_BEGIN(intrp_sclass,name)                 \
  340.     {                                 \
  341.     TOKENPASTE(im_,name)(TOKENPASTE(TAKE,type1)(0),            \
  342.             TOKENPASTE(TAKE,type2)(TOKENPASTE(DLSZ_,type1)),    \
  343.             TOKENPASTE(TAKE,type3)(2*TOKENPASTE(DLSZ_,type2)),    \
  344.             TOKENPASTE(TAKE,type4)(3*TOKENPASTE(DLSZ_,type3)),     \
  345.             TOKENPASTE(TAKE,type5)(4*TOKENPASTE(DLSZ_,type4)),     \
  346.             TOKENPASTE(TAKE,type6)(5*TOKENPASTE(DLSZ_,type5)));    \
  347.     thread(name);                         \
  348.     }                                 \
  349.     DL_INTRP_END(name)
  350.  
  351. #define DL_SPECMD_7(intrp_sclass,name,type1,type2,type3,type4,type5,type6,type7)    \
  352.     DL_IMMED_BEGIN(visible,name,( type1 x, type2 y, type3 z, type4 w, type5 q, type6 a, type7 b)) \
  353.     {                                 \
  354.     TOKENPASTE(im_,name)(x,y,z,w,q,a,b);            \
  355.     }                                 \
  356.     DL_IMMED_END(name)                         \
  357.     DL_CMPLR_BEGIN(visible,name,( type1 x, type2 y, type3 z, type4 w, type5 q, type6 a, type7 b)) \
  358.     {                                 \
  359.     BEGINCOMPILE(TOKENPASTE(DLSZ_,name));             \
  360.     ADDINTRP(name);                        \
  361.     TOKENPASTE(ADD,type1)(x);                 \
  362.     TOKENPASTE(ADD,type2)(y);                 \
  363.     TOKENPASTE(ADD,type3)(z);                 \
  364.     TOKENPASTE(ADD,type4)(w);                 \
  365.     TOKENPASTE(ADD,type5)(q);                 \
  366.     TOKENPASTE(ADD,type6)(a);                 \
  367.     TOKENPASTE(ADD,type7)(b);                 \
  368.     ENDCOMPILE(TOKENPASTE(DLSZ_,name));             \
  369.     }                                 \
  370.     DL_CMPLR_END(name)                         \
  371.     DL_INTRP_BEGIN(intrp_sclass,name)                 \
  372.     {                                 \
  373.     TOKENPASTE(im_,name)(TOKENPASTE(TAKE,type1)(0),        \
  374.             TOKENPASTE(TAKE,type2)(TOKENPASTE(DLSZ_,type1)),    \
  375.             TOKENPASTE(TAKE,type3)(2*TOKENPASTE(DLSZ_,type2)),    \
  376.             TOKENPASTE(TAKE,type4)(3*TOKENPASTE(DLSZ_,type3)),     \
  377.             TOKENPASTE(TAKE,type5)(4*TOKENPASTE(DLSZ_,type4)),     \
  378.             TOKENPASTE(TAKE,type6)(5*TOKENPASTE(DLSZ_,type5)),     \
  379.             TOKENPASTE(TAKE,type7)(6*TOKENPASTE(DLSZ_,type6)));    \
  380.     thread(name);                         \
  381.     }                                 \
  382.     DL_INTRP_END(name)
  383.  
  384. #define DL_GENCMD_CV2(intrp_sclass,name,type)            \
  385.     DL_IMMED_BEGIN(visible,name,( const type v[2]))        \
  386.     {                                 \
  387.     DL_EXTRA_IM_SETUP();                    \
  388.     TOKENPASTE(im_,name)(v[0],v[1]);            \
  389.     }                                 \
  390.     DL_IMMED_END(name)                         \
  391.     DL_CMPLR_BEGIN(visible,name,( const type v[2]))        \
  392.     {                                 \
  393.     BEGINCOMPILE(TOKENPASTE(DLSZ_,name));             \
  394.     ADDINTRP(name);                        \
  395.     ADDV2(type,v);                        \
  396.     ENDCOMPILE(TOKENPASTE(DLSZ_,name));             \
  397.     }                                 \
  398.     DL_CMPLR_END(name)                         \
  399.     DL_INTRP_BEGIN(intrp_sclass,name)                 \
  400.     {                                 \
  401.     TOKENPASTE(im_,name)(TOKENPASTE(TAKE,type)(0),            \
  402.             TOKENPASTE(TAKE,type)(TOKENPASTE(DLSZ_,type)));    \
  403.     thread(name);                         \
  404.     }                                 \
  405.     DL_INTRP_END(name)
  406.  
  407.  
  408. #define DL_GENCMD_CV3(intrp_sclass,name,type)            \
  409.     DL_IMMED_BEGIN(visible,name,( const type v[3]))        \
  410.     {                                 \
  411.     DL_EXTRA_IM_SETUP();                    \
  412.     TOKENPASTE(im_,name)(v[0],v[1],v[2]);            \
  413.     }                                 \
  414.     DL_IMMED_END(name)                         \
  415.     DL_CMPLR_BEGIN(visible,name,( const type v[3]))        \
  416.     {                                 \
  417.     BEGINCOMPILE(TOKENPASTE(DLSZ_,name));             \
  418.     ADDINTRP(name);                        \
  419.     ADDV3(type,v);                        \
  420.     TOKENPASTE(ADDFILL,type)();                \
  421.     ENDCOMPILE(TOKENPASTE(DLSZ_,name));             \
  422.     }                                 \
  423.     DL_CMPLR_END(name)                         \
  424.     DL_INTRP_BEGIN(intrp_sclass,name)                 \
  425.     {                                 \
  426.     TOKENPASTE(im_,name)(TOKENPASTE(TAKE,type)(0),            \
  427.             TOKENPASTE(TAKE,type)(TOKENPASTE(DLSZ_,type)),    \
  428.             TOKENPASTE(TAKE,type)(2*TOKENPASTE(DLSZ_,type)));     \
  429.     thread(name);                         \
  430.     }                                 \
  431.     DL_INTRP_END(name)
  432.  
  433. #define DL_GENCMD_CV4(intrp_sclass,name,type)            \
  434.     DL_IMMED_BEGIN(visible,name,( const type v[4]))        \
  435.     {                                 \
  436.     DL_EXTRA_IM_SETUP();                    \
  437.     TOKENPASTE(im_,name)(v[0],v[1],v[2],v[3]);        \
  438.     }                                 \
  439.     DL_IMMED_END(name)                         \
  440.     DL_CMPLR_BEGIN(visible,name,( const type v[4]))        \
  441.     {                                 \
  442.     BEGINCOMPILE(TOKENPASTE(DLSZ_,name));             \
  443.     ADDINTRP(name);                        \
  444.     ADDV4(type,v);                        \
  445.     ENDCOMPILE(TOKENPASTE(DLSZ_,name));             \
  446.     }                                 \
  447.     DL_CMPLR_END(name)                         \
  448.     DL_INTRP_BEGIN(intrp_sclass,name)                 \
  449.     {                                 \
  450.     TOKENPASTE(im_,name)(TOKENPASTE(TAKE,type)(0),            \
  451.             TOKENPASTE(TAKE,type)(TOKENPASTE(DLSZ_,type)),    \
  452.             TOKENPASTE(TAKE,type)(2*TOKENPASTE(DLSZ_,type)),    \
  453.             TOKENPASTE(TAKE,type)(3*TOKENPASTE(DLSZ_,type)));     \
  454.     thread(name);                         \
  455.     }                                 \
  456.     DL_INTRP_END(name)
  457.  
  458. #define DL_GENCMD_V2(intrp_sclass,name,type)            \
  459.     DL_IMMED_BEGIN(visible,name,( type v[2]))            \
  460.     {                                 \
  461.     DL_EXTRA_IM_SETUP();                    \
  462.     TOKENPASTE(im_,name)(v[0],v[1]);            \
  463.     }                                 \
  464.     DL_IMMED_END(name)                         \
  465.     DL_CMPLR_BEGIN(visible,name,( type v[2]))            \
  466.     {                                 \
  467.     BEGINCOMPILE(TOKENPASTE(DLSZ_,name));             \
  468.     ADDINTRP(name);                        \
  469.     ADDV2(type,v);                        \
  470.     ENDCOMPILE(TOKENPASTE(DLSZ_,name));             \
  471.     }                                 \
  472.     DL_CMPLR_END(name)                         \
  473.     DL_INTRP_BEGIN(intrp_sclass,aname)                 \
  474.     {                                 \
  475.     TOKENPASTE(im_,name)(TOKENPASTE(TAKE,type)(0),        \
  476.             TOKENPASTE(TAKE,type)(TOKENPASTE(DLSZ_,type)));    \
  477.     thread(name);                         \
  478.     }                                 \
  479.     DL_INTRP_END(name)
  480.  
  481.  
  482. #define DL_GENCMD_V3(intrp_sclass,name,type)            \
  483.     DL_IMMED_BEGIN(visible,name,( type v[3]))            \
  484.     {                                 \
  485.     DL_EXTRA_IM_SETUP();                    \
  486.     TOKENPASTE(im_,name)(v[0],v[1],v[2]);            \
  487.     }                                 \
  488.     DL_IMMED_END(name)                         \
  489.     DL_CMPLR_BEGIN(visible,name,( type v[3]))            \
  490.     {                                 \
  491.     BEGINCOMPILE(TOKENPASTE(DLSZ_,name));             \
  492.     ADDINTRP(name);                        \
  493.     ADDV3(type,v);                        \
  494.     TOKENPASTE(ADDFILL,type)();                \
  495.     ENDCOMPILE(TOKENPASTE(DLSZ_,name));             \
  496.     }                                 \
  497.     DL_CMPLR_END(name)                         \
  498.     DL_INTRP_BEGIN(intrp_sclass,name)                 \
  499.     {                                 \
  500.     TOKENPASTE(im_,name)(TOKENPASTE(TAKE,type)(0),        \
  501.             TOKENPASTE(TAKE,type)(TOKENPASTE(DLSZ_,type)),    \
  502.             TOKENPASTE(TAKE,type)(2*TOKENPASTE(DLSZ_,type)));     \
  503.     thread(name);                         \
  504.     }                                 \
  505.     DL_INTRP_END(name)
  506.  
  507. #define DL_GENCMD_V4(intrp_sclass,name,type)            \
  508.     DL_IMMED_BEGIN(visible,name,( type v[4]))            \
  509.     {                                 \
  510.     DL_EXTRA_IM_SETUP();                    \
  511.     TOKENPASTE(im_,name)(v[0],v[1],v[2],v[3]);        \
  512.     }                                 \
  513.     DL_IMMED_END(name)                         \
  514.     DL_CMPLR_BEGIN(visible,name,( type v[4]))            \
  515.     {                                 \
  516.     BEGINCOMPILE(TOKENPASTE(DLSZ_,name));             \
  517.     ADDINTRP(name);                        \
  518.     ADDV4(type,v);                        \
  519.     ENDCOMPILE(TOKENPASTE(DLSZ_,name));             \
  520.     }                                 \
  521.     DL_CMPLR_END(name)                         \
  522.     DL_INTRP_BEGIN(intrp_sclass,name)                 \
  523.     {                                 \
  524.     TOKENPASTE(im_,name)(TOKENPASTE(TAKE,type)(0),            \
  525.             TOKENPASTE(TAKE,type)(TOKENPASTE(DLSZ_,type)),    \
  526.             TOKENPASTE(TAKE,type)(2*TOKENPASTE(DLSZ_,type)),    \
  527.             TOKENPASTE(TAKE,type)(3*TOKENPASTE(DLSZ_,type)));     \
  528.     thread(name);                         \
  529.     }                                 \
  530.     DL_INTRP_END(name)
  531.  
  532. #if defined(LIGHT)||defined(NEWPORT)
  533. /* 
  534.  * the following is used only by LIGHT gfx, so to be safe its ifdef'ed
  535.  * however, it might be usefull to others also
  536.  */
  537. #define DL_VERTEX(name,n,type,taketype)                \
  538.     DL_IMMED_BEGIN(visible,name,(register type v[n]))        \
  539.     {                                \
  540.     im_setup;                        \
  541.     TOKENPASTE(im_,name)(v);                \
  542.     }                                \
  543.     DL_IMMED_END(name)                        \
  544.     DL_CMPLR_BEGIN(visible,name,(register type v[n]))        \
  545.     {                                \
  546.     BEGINCOMPILE(TOKENPASTE(DLSZ_,name));            \
  547.     ADDINTRP(name);                        \
  548.     TOKENPASTE(ADDV,n)(taketype,v);                \
  549.     ENDCOMPILE(TOKENPASTE(DLSZ_,name));            \
  550.     }                                \
  551.     DL_CMPLR_END(name)                        \
  552.     DL_INTRP_BEGIN(visible,name)                \
  553.     {                                \
  554.     TOKENPASTE(im_,name)(TAKEV(taketype,0));        \
  555.     thread(name);                        \
  556.     }                                \
  557.     DL_INTRP_END(name)
  558. #endif
  559.  
  560. #endif    /* !__GL_IMINTERP_H__ */
  561.